.class public Lcom/glympse/platform/common/CharArrayPointer;
.super Ljava/lang/Object;
.source "CharArrayPointer.java"


# instance fields
.field private m_acData:[C

.field public m_cCur:C

.field private m_nLength:I

.field private m_nOffset:I


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 3
    .parameter "strBuffer"

    .prologue
    const/4 v2, 0x0

    .line 53
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 18
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    .line 19
    iput v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    .line 20
    iput v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    .line 21
    iput-char v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 56
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v0

    iput v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    .line 57
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    new-array v1, v1, [C

    iput-object v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    invoke-virtual {p1, v2, v0, v1, v2}, Ljava/lang/String;->getChars(II[CI)V

    .line 60
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    if-ge v0, v1, :cond_0

    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    aget-char v0, v0, v1

    :goto_0
    iput-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 61
    return-void

    :cond_0
    move v0, v2

    .line 60
    goto :goto_0
.end method

.method public constructor <init>([B)V
    .locals 7
    .parameter "abData"

    .prologue
    const/4 v6, 0x0

    .line 24
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 18
    const/4 v2, 0x0

    iput-object v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    .line 19
    iput v6, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    .line 20
    iput v6, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    .line 21
    iput-char v6, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 29
    :try_start_0
    invoke-static {p1}, Lcom/glympse/platform/Platform;->ByteArrayToString([B)Ljava/lang/String;

    move-result-object v1

    .line 32
    .local v1, strBuffer:Ljava/lang/String;
    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v2

    iput v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    .line 33
    const/4 v2, 0x0

    iget v3, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    iget v4, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    new-array v4, v4, [C

    iput-object v4, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    const/4 v5, 0x0

    invoke-virtual {v1, v2, v3, v4, v5}, Ljava/lang/String;->getChars(II[CI)V

    .line 36
    iget v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    iget v3, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    if-ge v2, v3, :cond_0

    iget-object v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    iget v3, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    aget-char v2, v2, v3

    :goto_0
    iput-char v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 42
    .end local v1           #strBuffer:Ljava/lang/String;
    :goto_1
    return-void

    .restart local v1       #strBuffer:Ljava/lang/String;
    :cond_0
    move v2, v6

    .line 36
    goto :goto_0

    .line 38
    .end local v1           #strBuffer:Ljava/lang/String;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 40
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_1
.end method

.method public constructor <init>([C)V
    .locals 3
    .parameter "acData"

    .prologue
    const/4 v2, 0x0

    .line 45
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 18
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    .line 19
    iput v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    .line 20
    iput v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    .line 21
    iput-char v2, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 47
    iput-object p1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    .line 48
    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    array-length v0, v0

    iput v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    .line 49
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    if-ge v0, v1, :cond_0

    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    aget-char v0, v0, v1

    :goto_0
    iput-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 50
    return-void

    :cond_0
    move v0, v2

    .line 49
    goto :goto_0
.end method


# virtual methods
.method public GetCharArray()[C
    .locals 1

    .prologue
    .line 72
    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    return-object v0
.end method

.method public GetCurPosition()I
    .locals 1

    .prologue
    .line 78
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    return v0
.end method

.method public Inc()V
    .locals 2

    .prologue
    .line 91
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    .line 92
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    if-ge v0, v1, :cond_0

    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    aget-char v0, v0, v1

    :goto_0
    iput-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 93
    return-void

    .line 92
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public IsEnd()Z
    .locals 1

    .prologue
    .line 98
    iget-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public IsLineEnd()Z
    .locals 2

    .prologue
    .line 104
    iget-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    if-eqz v0, :cond_0

    const/16 v0, 0xd

    iget-char v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    if-eq v0, v1, :cond_0

    const/16 v0, 0xa

    iget-char v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    if-eq v0, v1, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public IsSpace()Z
    .locals 2

    .prologue
    .line 110
    iget-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    const/16 v1, 0x9

    if-lt v0, v1, :cond_0

    iget-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    const/16 v1, 0xd

    if-le v0, v1, :cond_1

    :cond_0
    iget-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    const/16 v1, 0x20

    if-eq v0, v1, :cond_1

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public IsValid()Z
    .locals 1

    .prologue
    .line 66
    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public SetCurPosition(I)V
    .locals 2
    .parameter "nPosition"

    .prologue
    .line 84
    iput p1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    .line 85
    iget v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nLength:I

    if-ge v0, v1, :cond_0

    iget-object v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_acData:[C

    iget v1, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_nOffset:I

    aget-char v0, v0, v1

    :goto_0
    iput-char v0, p0, Lcom/glympse/platform/common/CharArrayPointer;->m_cCur:C

    .line 86
    return-void

    .line 85
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
